-
Notifications
You must be signed in to change notification settings - Fork 11
Added versioning configuration for COS buckets in CSI driver #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
if val, ok := secretMap["BucketVersioning"]; ok && val != "" { | ||
enable := strings.ToLower(strings.TrimSpace(val)) | ||
if enable != "true" && enable != "false" { | ||
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Invalid BucketVersioning value in secret: %s. Must be 'true' or 'false'", val)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please log secret name as well her.
status.Error(codes.InvalidArgument, fmt.Sprintf("Invalid BucketVersioning value in secret: %s. Value set %s. Must be 'true' or 'false'", secretName, val))
fmt.Sprintf("Invalid BucketVersioning value in storage class: %s. Must be 'true' or 'false'", val)) | ||
} | ||
BucketVersioning = enable | ||
klog.Infof("BucketVersioning set via storage class: %s", BucketVersioning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
klog.Infof("BucketVersioning value that will be set via storage class params: %s", BucketVersioning)
@@ -48,6 +48,7 @@ func (cs *controllerServer) CreateVolume(_ context.Context, req *csi.CreateVolum | |||
kpRootKeyCrn string | |||
pvcName string | |||
pvcNamespace string | |||
BucketVersioning string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bucketVersioning
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Invalid BucketVersioning value in secret: %s. Must be 'true' or 'false'", val)) | ||
} | ||
BucketVersioning = enable | ||
klog.Infof("BucketVersioning set via secret: %s", BucketVersioning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
klog.Infof("BucketVersioning value that will be set via secret: %s", BucketVersioning)
@@ -441,6 +479,7 @@ func parseCustomSecret(secret *v1.Secret) map[string]string { | |||
iamEndpoint string | |||
cosEndpoint string | |||
locationConstraint string | |||
BucketVersioning string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bucketVersioning
@@ -479,6 +518,10 @@ func parseCustomSecret(secret *v1.Secret) map[string]string { | |||
locationConstraint = string(bytesVal) | |||
} | |||
|
|||
if bytesVal, ok := secret.Data["BucketVersioning"]; ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bucketVersioning
-> small case in the start to comply with how other params are set in the secret.
Adds support for enabling versioning on COS buckets via the IBM COS CSI driver